<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/finance/djlc/cw_djlc_analyze_table.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/finance/djlc/cw_djlc_analyze_table.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'cw_djlc_analyze_id',
                footer: "Foots",
                cnName: '定价差异分析表',
                name: 'djlc/cw_djlc_analyze_table',
                url: "/cw_djlc_analyze_table/",
                sortName: "oldprice,newprice,analyzeprice "
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
            const searchFormFields = ref({"oldcomponentnum":"","olddescription":"","analyzeprice":[null,null],"groupnum":""});
            const searchFormOptions = ref([[{"title":"物料编号","field":"oldcomponentnum","type":"like"},{"title":"物料描述","field":"olddescription","type":"like"}],[{"title":"差异价格","field":"analyzeprice","type":"range"},{"dataKey":"产品定价分组规则","data":[],"title":"分组编码","field":"groupnum","type":"select"}]]);
            const columns = ref([{field:'cw_djlc_analyze_id',title:'差异分析id',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'cw_djlc_djzb_id',title:'定价主表id',type:'guid',width:110,hidden:true,align:'left'},
                       {field:'cw_djlc_code',title:'定价流程编号',type:'string',width:220,hidden:true,align:'left'},
                       {field:'oldcomponentnum',title:'物料编号',type:'string',width:220,align:'left',sort:true},
                       {field:'oldnum',title:'对标物料子件数量',type:'decimal',width:130,align:'left'},
                       {field:'oldUnitprice',title:'对标物料子件单价',type:'decimal',width:130,align:'left'},
                       {field:'oldprice',title:'对标物料子件价格',type:'decimal',width:130,align:'left'},
                       {field:'olddescription',title:'物料描述',type:'string',width:220,align:'left'},
                       {field:'newcomponentnum',title:'需求物料子件编号',type:'string',width:220,align:'left'},
                       {field:'newdescription',title:'需求物料子件描述',type:'string',width:220,align:'left'},
                       {field:'newnum',title:'需求物料子件数量',type:'decimal',width:130,align:'left'},
                       {field:'newUnitprice',title:'需求物料子件单价',type:'decimal',width:130,align:'left'},
                       {field:'newprice',title:'需求物料子件价格',type:'decimal',width:130,align:'left'},
                       {field:'analyzeprice',title:'差异价格',type:'decimal',width:110,align:'left'},
                       {field:'groupnum',title:'分组编码',type:'string',bind:{ key:'产品定价分组规则',data:[]},width:110,align:'left'},
                       {field:'groupnumname',title:'分组名称',type:'string',width:220,align:'left'},
                       {field:'Creator',title:'创建人',type:'string',width:100,hidden:true,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'Modifier',title:'修改人',type:'string',width:100,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,hidden:true,align:'left',sort:true}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
